package com.zhbr.mvp.model;


import com.zhbr.common.rx.RxUtil;
import com.zhbr.mvp.contract.LoginContract;
import com.zhbr.mvp.base.model.BaseModel;

import java.util.Map;

import rx.Subscriber;
import rx.Subscription;

import static com.zhbr.common.rx.RxUtil.*;

public class LoginModel extends BaseModel implements LoginContract.Model {


    @Override
    public void login(Map map, Subscriber subscriber) {
        Subscription subscription;
        subscription=mApi.login(map).compose(applySchedulers()).compose(RxUtil.handleResult()).subscribe(subscriber);
        addSubscribe(subscription);
    }
}
